package com.example.apple.paopo.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.apple.paopo.R;
import com.orhanobut.logger.Logger;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by apple on 17/12/17.
 */
public class mRecommendedAdapter extends RecyclerView.Adapter {

    private List<String> mDatas;
    private Context mContext;
    private LayoutInflater inflater;

    public mRecommendedAdapter(Context context, ArrayList arrayList) {
        this. mContext=context;
        this. mDatas=arrayList;
        inflater=LayoutInflater. from(mContext);
    }

//    @Override
//    public void onBindViewHolder(MyViewHolder holder, int position) {
//        holder.tv.setText(mDatas.get(position));
//    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.mrecommendedadapter_item,parent, false);
        MyViewHolder holder= new MyViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        MyViewHolder myViewHolder=(MyViewHolder)holder;
       // myViewHolder.tv.setText(mDatas.get(position));
    }


    @Override
    public int getItemCount() {
        Logger.d(String.valueOf(mDatas.size()));
        return mDatas.size();
    }

    private class MyViewHolder extends RecyclerView.ViewHolder {
        TextView tv;
        public MyViewHolder(View view) {
            super(view);
          //  tv=(TextView) view.findViewById(R.id.tv_item);

        }
    }
}
